import request from '@/utils/request'

/**
 * 分页查询
 * @param data
 * @returns {AxiosPromise}
 */
export function queryPage(data) {
  return request({
    url: '/wordSystemEnStudent/queryPage',
    method: 'POST',
    data
  })
}

/**
 * 保存或更新
 * @param data
 * @returns {AxiosPromise}
 */
export function saveOrUpdate(data) {
  return request({
    url: '/wordSystemEnStudent/saveOrUpdate',
    method: 'POST',
    data
  })
}

/**
 * 充值
 * @param data
 * @returns {*}
 */
export function recharge(data) {
  return request({
    url: '/wordSystemEnStudent/recharge',
    method: 'POST',
    data
  })
}

/**
 * 获取当前课程剩余时间
 * @param data
 * @returns {*}
 */
export function pullCurrentCourseHours(data) {
  return request({
    url: '/wordSystemEnStudent/getCurrentCourseHours',
    method: 'POST',
    data
  })
}

/**
 * 切换词库界面的数据
 * @param params
 * @returns {AxiosPromise}
 */
export function changeBookPageInfo(params) {
  return request({
    url: '/wordSystemEnStudent/changeBookPageInfo',
    method: 'POST',
    params
  })
}

/**
 * 更新词库
 * @param params
 * @returns {*}
 */
export function setNewBookNowStudy(params) {
  return request({
    url: '/wordSystemEnStudent/setNewBookNowStudy',
    method: 'POST',
    params
  })
}

/**
 * 删除学生
 * @param params
 * @returns {*}
 */
export function delStudent(params) {
  return request({
    url: '/wordSystemEnStudent/deleteStudent',
    method: 'POST',
    params
  })
}

/**
 * 学员端授权
 * @param params
 * @returns {*}
 */
export function grantPermissions(params) {
  return request({
    url: '/wordSystemEnStudent/grantPermissions',
    method: 'POST',
    params
  })
}

/**
 * 获取速登密钥
 * @param params
 * @returns {*}
 */
export function quickLoginCertificate(params) {
  return request({
    url: '/wordSystemEnStudent/getQuickLoginKey',
    method: 'POST',
    params
  })
}

/**
 * 重置速登密钥
 * @param params
 * @returns {*}
 */
export function resetQuickLoginKey(params) {
  return request({
    url: '/wordSystemEnStudent/resetQuickLoginKey',
    method: 'POST',
    params
  })
}
